<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta charset="UTF-8">
    <title>有奖竞答</title>
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/result2.css?v="+(new Date()).getSeconds()>
    <script type="text/javascript" src="./lib/js/evm.js"></script>
    <script type="text/javascript" src="./lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="./lib/js/key.js"></script>
    <script src="./lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="./js/getId.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <div class="main">
        <div class="banner" style="display:none;">
            <img src="images/result_banner.png" alt="banner">
        </div>
        <div id="indexMain">
            <!-- <div class="model" id="model1" >2019年广场舞金牌领队投票</div>
            <div class="model" id="model2" >2019年广场舞人气舞队投票</div>
            <div class="model" id="model3" >2019年首页电视问答</div> -->
            <div class="model" id="model4"></div>
            
            <div id="content">
                <div id="d1">0</div>
                <div id="d2">0</div>
                <div id="d3">0</div>
                <div id="d4">0</div>
            </div>
        </div>
    </div>
    <script>
        //根据传入的id，设置对应的图片
        console.log(document.getElementsByClassName('main')[0]);
        var currentId = getCookie('base_id');
        console.log(currentId)
        document.getElementsByClassName('main')[0].style.backgroundImage ='url("./public/upload/admin/yjjd/'+ currentId +'/bg.png")'
      // document.body.style.backgroundImage ='url("./public/upload/admin/yjjd/'+ currentId +'/bg.png")'
    </script>
    <script>
        // function getParamer(paramer){
        //     var url=window.location.href.split("?")[1];            /*获取url里"?"后面的值*/
        //     if(url.indexOf("&")>0){                                      /*判断是否是一个参数还是多个参数*/
        //         urlParamArry=url.split("&");                            /*分开每个参数，并放到数组里*/
        //         for(var i=0; i<urlParamArry.length; i++){
        //             var paramerName=urlParamArry[i].split("=");   /*把每个参数名和值分开，并放到数组里*/
        //             if(paramer==paramerName[0]){                     /*匹配输入的参数和数组循环出来的参数是否一样*/
        //                 return paramerName[1];                           /*返回想要的参数值*/
        //             }
        //         }
        //     }else{                                                              /*判断只有个参数*/
        //         var paramerValue=url.split("=")[1];
        //         return paramerValue;
        //     }

        // }
        var resultNum = getParam('sum');
        var resultScore = getParam('answer_rate').replace (/^\s*|\s*$/g,'');
        // $('#content li:nth-child(1)').html(resultNum);
        document.getElementById('d1').innerHTML=resultNum ;
        // alert(document.getElementById('d1').innerHTML);
        //alert(resultNum);
        //alert(resultScore.length)
        if(resultScore.length && resultScore.length == 1){
            // $('#content li:last-child').html(resultScore)
            document.getElementById('d4').innerHTML=resultNum 
        }else if(resultScore.length == 2){
            var arr = resultScore.split('')
            // $('#content li:nth-child(3)').html(arr[0])
            // $('#content li:nth-child(4)').html(arr[1])
            document.getElementById('d3').innerHTML=arr[0];
            document.getElementById('d4').innerHTML=arr[1];
        }else if(resultScore.length == 3){
            var arr = resultScore.split('')
            // $('#content li:nth-child(2)').html(arr[0])
            // $('#content li:nth-child(3)').html(arr[1])
            // $('#content li:nth-child(4)').html(arr[2])
            document.getElementById('d2').innerHTML=arr[0];
            document.getElementById('d3').innerHTML=arr[1];
            document.getElementById('d4').innerHTML=arr[2];
        }
        var modelIndex = {
            disHeader: false,
            isVideo: false,
            isIndex: true,
            index: 0,//初始位置
            listName: 'model', //模块名称
            containerId: 'indexMain'//包含模块的标签id
        }
        var data = [
          //  {
          //      name: '2019年广场舞金牌领队投票',
          //      url: 'http://10.2.11.143/zhubo2019/2019gcw/dance_king/playerListVote.htm?pos=1&gcw_id=20&key=index'
          //  },
          //  {
          //      name: '2019年广场舞人气舞队投票',
          //      url: 'http://10.2.11.143/zhubo2019/2019gcw/dance_king/playerListVote.htm?pos=1&gcw_id=21&key=index'
          //  },
          //  {
          //      name: '2019年首页电视问答',
          //      url: 'index.html'
          //  },
            {
                name:'退出',
                url:'./index.html'
            }
        ]

        function direOpt(index, directive) {
          
            /*if (directive == "up") {//上
                if (index <= 3 && index > 0) {
                    index --
                }
            } else if (directive == "down") {//下
                if (index >= 0 && index < 3) {
                    index ++
                }
            }*/
            return index;
        }
        function direEnter(index) {
          // alert(index)
          document.getElementById('test').innerHTML = index
            if (data[index].url) {
                window.location.href = data[index].url
            }
        }
    </script>
    <script type="text/javascript" src="js/yuan/main1.js"></script>
</body>
</html>
